#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int a, b;
	while (scanf("%d %d", &a, &b))
	{
		int ret1 = a / b;
		int ret2 = a % b;
		printf("%d %d", ret1, ret2);
	}
	return 0;
}

